Optimal. Leaf size=41 \[ -\frac {1}{2} \sqrt {\frac {\pi }{2}} \text {FresnelC}\left (\frac {1+2 x}{\sqrt {2 \pi }}\right )+\frac {1}{2} \sin \left (\frac {1}{4}+x+x^2\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.01, antiderivative size = 41, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {3543, 3527,
3433} \begin {gather*} \frac {1}{2} \sin \left (x^2+x+\frac {1}{4}\right )-\frac {1}{2} \sqrt {\frac {\pi }{2}} \text {FresnelC}\left (\frac {2 x+1}{\sqrt {2 \pi }}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3433
Rule 3527
Rule 3543
Rubi steps
\begin {align*} \int x \cos \left (\frac {1}{4}+x+x^2\right ) \, dx &=\frac {1}{2} \sin \left (\frac {1}{4}+x+x^2\right )-\frac {1}{2} \int \cos \left (\frac {1}{4}+x+x^2\right ) \, dx\\ &=\frac {1}{2} \sin \left (\frac {1}{4}+x+x^2\right )-\frac {1}{2} \int \cos \left (\frac {1}{4} (1+2 x)^2\right ) \, dx\\ &=-\frac {1}{2} \sqrt {\frac {\pi }{2}} C\left (\frac {1+2 x}{\sqrt {2 \pi }}\right )+\frac {1}{2} \sin \left (\frac {1}{4}+x+x^2\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.06, size = 39, normalized size = 0.95 \begin {gather*} \frac {1}{4} \left (-\sqrt {2 \pi } \text {FresnelC}\left (\frac {1+2 x}{\sqrt {2 \pi }}\right )+2 \sin \left (\frac {1}{4}+x+x^2\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.06, size = 30, normalized size = 0.73
method | result | size |
default | \(\frac {\sin \left (\frac {1}{4}+x +x^{2}\right )}{2}-\frac {\sqrt {2}\, \sqrt {\pi }\, \FresnelC \left (\frac {\sqrt {2}\, \left (x +\frac {1}{2}\right )}{\sqrt {\pi }}\right )}{4}\) | \(30\) |
risch | \(\frac {\sqrt {\pi }\, \left (-1\right )^{\frac {3}{4}} \erf \left (\left (-1\right )^{\frac {1}{4}} x +\frac {\left (-1\right )^{\frac {1}{4}}}{2}\right )}{8}-\frac {\sqrt {\pi }\, \erf \left (\sqrt {-i}\, x -\frac {i}{2 \sqrt {-i}}\right )}{8 \sqrt {-i}}+\frac {\sin \left (\frac {\left (1+2 x \right )^{2}}{4}\right )}{2}\) | \(58\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains complex when optimal does not.
time = 0.56, size = 126, normalized size = 3.07 \begin {gather*} \frac {8 \, x {\left (-i \, e^{\left (i \, x^{2} + i \, x + \frac {1}{4} i\right )} + i \, e^{\left (-i \, x^{2} - i \, x - \frac {1}{4} i\right )}\right )} + \sqrt {4 \, x^{2} + 4 \, x + 1} {\left (\left (i - 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\sqrt {i \, x^{2} + i \, x + \frac {1}{4} i}\right ) - 1\right )} - \left (i + 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\sqrt {-i \, x^{2} - i \, x - \frac {1}{4} i}\right ) - 1\right )}\right )} - 4 i \, e^{\left (i \, x^{2} + i \, x + \frac {1}{4} i\right )} + 4 i \, e^{\left (-i \, x^{2} - i \, x - \frac {1}{4} i\right )}}{16 \, {\left (2 \, x + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.43, size = 32, normalized size = 0.78 \begin {gather*} -\frac {1}{4} \, \sqrt {2} \sqrt {\pi } \operatorname {C}\left (\frac {\sqrt {2} {\left (2 \, x + 1\right )}}{2 \, \sqrt {\pi }}\right ) + \frac {1}{2} \, \sin \left (x^{2} + x + \frac {1}{4}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 155 vs.
\(2 (39) = 78\).
time = 0.68, size = 155, normalized size = 3.78 \begin {gather*} - \frac {\sqrt {2} \sqrt {\pi } x C\left (\frac {\sqrt {2} x}{\sqrt {\pi }} + \frac {\sqrt {2}}{2 \sqrt {\pi }}\right ) \Gamma \left (\frac {1}{4}\right )}{8 \Gamma \left (\frac {5}{4}\right )} + \frac {\sqrt {2} \sqrt {\pi } x C\left (\frac {\sqrt {2} x}{\sqrt {\pi }} + \frac {\sqrt {2}}{2 \sqrt {\pi }}\right )}{2} + \frac {\sin {\left (\left (x + \frac {1}{2}\right )^{2} \right )} \Gamma \left (\frac {1}{4}\right )}{8 \Gamma \left (\frac {5}{4}\right )} - \frac {\sqrt {2} \sqrt {\pi } C\left (\frac {\sqrt {2} x}{\sqrt {\pi }} + \frac {\sqrt {2}}{2 \sqrt {\pi }}\right ) \Gamma \left (\frac {1}{4}\right )}{16 \Gamma \left (\frac {5}{4}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [C] Result contains complex when optimal does not.
time = 0.47, size = 65, normalized size = 1.59 \begin {gather*} \left (\frac {1}{16} i + \frac {1}{16}\right ) \, \sqrt {2} \sqrt {\pi } \operatorname {erf}\left (\left (\frac {1}{4} i - \frac {1}{4}\right ) \, \sqrt {2} {\left (2 \, x + 1\right )}\right ) - \left (\frac {1}{16} i - \frac {1}{16}\right ) \, \sqrt {2} \sqrt {\pi } \operatorname {erf}\left (-\left (\frac {1}{4} i + \frac {1}{4}\right ) \, \sqrt {2} {\left (2 \, x + 1\right )}\right ) - \frac {1}{4} i \, e^{\left (i \, x^{2} + i \, x + \frac {1}{4} i\right )} + \frac {1}{4} i \, e^{\left (-i \, x^{2} - i \, x - \frac {1}{4} i\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.48, size = 32, normalized size = 0.78 \begin {gather*} \frac {\sin \left (x^2+x+\frac {1}{4}\right )}{2}-\frac {\sqrt {2}\,\sqrt {\pi }\,\mathrm {C}\left (\frac {\sqrt {2}\,\left (2\,x+1\right )}{2\,\sqrt {\pi }}\right )}{4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________